home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / comm / net / AmiMUD.lha / AmiMUD / rexx / backstab.amud next >
Text File  |  1997-08-21  |  927b  |  38 lines

  1. /* Test dei backstab */
  2.  
  3. /* This is a medievia script and has to be launched once amimud is started,
  4.    it does an infinite loop in which it searches for backstab triggers,
  5.    if found the right variable is incremented.
  6.  */
  7.  
  8. address 'AmiMUD.1'
  9.  
  10. 'am_addmacro "backstatus" "#echo Backstab: $back_ok hit - $back_fail miss ($back_total total)\n"'
  11.  
  12. 'am_addtrigger "ou lunge at" "#backstatus\n" REXXTRIGGER'
  13.  
  14. failed=TRIGGER
  15.  
  16. 'am_addtrigger "ou plunge" "#backstatus\n" REXXTRIGGER'
  17. hit=TRIGGER
  18.  
  19. 'am_addtrigger "makes a strange" "#backstatus\n" REXXTRIGGER'
  20. killed=TRIGGER
  21.  
  22. backstab_ok=0
  23. backstab_failed=0
  24.  
  25. do forever
  26.     'am_setvar back_fail ' backstab_failed
  27.     'am_setvar back_ok ' backstab_ok
  28.     'am_setvar back_total' backstab_ok+backstab_failed
  29.  
  30.     'am_waittriggers REXXONLY'
  31.  
  32.     if TRIGGER=killed then backstab_ok=backstab_ok+1
  33.  
  34.     if TRIGGER=hit then backstab_ok=backstab_ok+1
  35.  
  36.     if TRIGGER=failed then backstab_failed=backstab_failed+1
  37.  
  38. end